/////////////////////////////////////////////////////////////////////////////
// Name:        DownloadIniDialog.h
// Purpose:     
// Author:      yospaly
// Modified by: 
// Created:     08/01/2009 13:54:31
// RCS-ID:      
// Copyright:   Copyright (C) 2008, yospaly
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#ifndef _DOWNLOADINIDIALOG_H_
#define _DOWNLOADINIDIALOG_H_


/*!
 * Includes
 */

////@begin includes
#include "wx/statline.h"
////@end includes
#include <wx/stopwatch.h>

/*!
 * Forward declarations
 */

////@begin forward declarations
////@end forward declarations

/*!
 * Control identifiers
 */

////@begin control identifiers
#define ID_DOWNLOAD_INI_DIALOG 10005
#define ID_GAUGE 10036
#define SYMBOL_DOWNLOADINIPANEL_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxTAB_TRAVERSAL
#define SYMBOL_DOWNLOADINIPANEL_TITLE _("Downloading setup.ini ...")
#define SYMBOL_DOWNLOADINIPANEL_IDNAME ID_DOWNLOAD_INI_DIALOG
#define SYMBOL_DOWNLOADINIPANEL_SIZE wxSize(400, 300)
#define SYMBOL_DOWNLOADINIPANEL_POSITION wxDefaultPosition
////@end control identifiers


/*!
 * DownloadIniPanel class declaration
 */

class DownloadIniPanel: public wxPanel
{    
    DECLARE_DYNAMIC_CLASS( DownloadIniPanel )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    DownloadIniPanel();
    DownloadIniPanel( wxWindow* parent, wxWindowID id = SYMBOL_DOWNLOADINIPANEL_IDNAME, const wxString& caption = SYMBOL_DOWNLOADINIPANEL_TITLE, const wxPoint& pos = SYMBOL_DOWNLOADINIPANEL_POSITION, const wxSize& size = SYMBOL_DOWNLOADINIPANEL_SIZE, long style = SYMBOL_DOWNLOADINIPANEL_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_DOWNLOADINIPANEL_IDNAME, const wxString& caption = SYMBOL_DOWNLOADINIPANEL_TITLE, const wxPoint& pos = SYMBOL_DOWNLOADINIPANEL_POSITION, const wxSize& size = SYMBOL_DOWNLOADINIPANEL_SIZE, long style = SYMBOL_DOWNLOADINIPANEL_STYLE );

    /// Destructor
    ~DownloadIniPanel();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

////@begin DownloadIniPanel event handler declarations

////@end DownloadIniPanel event handler declarations

////@begin DownloadIniPanel member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end DownloadIniPanel member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin DownloadIniPanel member variables
    wxStaticText* p_download_info_static;
    wxStaticText* p_download_progress_static;
    wxGauge* p_download_gauge;
////@end DownloadIniPanel member variables
public :
	void OnBeginDownload(wxCommandEvent &event);
    void OnDownloading(wxCommandEvent &event);
    void OnDownloadCompleted(wxCommandEvent &event);

    DownloadIniPanel(wxWindow* parent, wxWindowID id = SYMBOL_DOWNLOADINIPANEL_IDNAME, \
            const wxPoint& pos = SYMBOL_DOWNLOADINIPANEL_POSITION, const wxSize& size = SYMBOL_DOWNLOADINIPANEL_SIZE, \
            long style = SYMBOL_DOWNLOADINIPANEL_STYLE, const wxString& name = _T("proxypanel"))
    {
        Init();
        Create(parent, id, SYMBOL_DOWNLOADINIPANEL_TITLE, pos, size, style);
    }
    
protected :
	wxString _file_size_str;
	int _file_size;
	
	wxStopWatch _watch;
};

#endif
    // _DOWNLOADINIDIALOG_H_
